/* 
 * File:   Locate.h
 * Author: dave
 *
 * Created on 2010年11月1日, 上午10:39
 */

#ifndef _LOCATE_H
#define	_LOCATE_H

#include "Data.h"
#include "cv.h"
#include "highgui.h"
#include <queue>
#include <vector>
using namespace std;

class Locate {
public:
    //保存检测到的活动区域
    vector<trackObject> V;
    //图像缓存
    CvMat * scanMat;
    IplImage * tmpScan;
    BwImage scanImg;

    Locate(Camera *camera);
    Locate(const Locate& orig);

    //扫描定位
    void scan(CvMat * mat);

    void Draw(IplImage * image, CvScalar color);

    virtual ~Locate();


private:
    Camera *cam;
    //广度优先遍历队列
    queue<CvPoint> Q;

    //区域填充
    void floodFill(float val, int X, int Y, int & min_x, int & max_x, int & min_y, int & max_y);
};



#endif	/* _LOCATE_H */

